from django.db import models


# Create your models here. serializers

class ComponentType(models.Model):
    name = models.CharField(verbose_name="类型名称", max_length=32)
    icon = models.CharField(verbose_name="类型icon", max_length=32)


class ComponentRenderType(models.Model):
    name = models.CharField(verbose_name="渲染器名称", max_length=32)


class Component(models.Model):
    name = models.CharField(verbose_name="组件名称", max_length=32)
    component_render_type = models.ForeignKey(ComponentRenderType, verbose_name="组件渲染器类型", on_delete=models.SET_NULL,
                                              null=True)
    component_type = models.ForeignKey(ComponentType, verbose_name="组件的类型", on_delete=models.SET_NULL, null=True)
    config = models.TextField(verbose_name="组件的配置")
